package com.qfedu.meidijiaju.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author meidimeiju
 * @since 2022-10-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class CommentsYxy implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * 评论id
     */
    @ApiModelProperty(value = "评论id")
    @TableId(value = "id", type = IdType.AUTO)
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private Integer id;

    /**
     * 内容
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "内容")
    private String content;

    /**
     * 时间
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date date;

    /**
     * 谁评论的？
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "谁评论的？")
    private Integer userId;

    /**
     * 评论的对应帖子id
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "评论的对应帖子id")
    private Integer cardId;

    /**
     * 对应作者
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @TableField(exist = false)
    private AuthorYxy user;

    public CommentsYxy(Integer id, String content, Date date, Integer userId, Integer cardId) {
        this.id = id;
        this.content = content;
        this.date = date;
        this.userId = userId;
        this.cardId = cardId;
    }
}
